package com.community.property.mapper;


import com.community.property.domain.VO.PropertyBuildingVo;
import com.community.property.domain.VO.PropertyCommunityVO;
import com.community.property.domain.VO.PropertyHouseVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PropertyHouseMapper {

    /**
     * 根据社区id获取房屋列表
     *
     * @return
     */

    @Select("SELECT `community_id`as communityId, `name`as name FROM `community`")
    List<PropertyCommunityVO> getCommunity();

    @Select("SELECT community_id as communityId,building_id as buildingId,NAME FROM `building` WHERE community_id=#{communityId}")
    List<PropertyBuildingVo> getBuilding(Integer communityId);

    @Select("SELECT house_id as houseId,room_no as roomNo FROM `house` WHERE building_id=#{buildingId}")
    List<PropertyHouseVO> getHouse(Integer buildingId);
}
